using System;
using OracleInternal.Common;

namespace OracleInternal.MTS
{
	internal class DTCDebugConfig
	{
		internal const string DTC_DEBUG_EVENT_TAG = "DTC_DEBUG_EVENT";

		internal const uint DTC_DEFAULT_ABORT_TIMEOUT = 2u;

		internal static DTCDebugEvent s_DTCDbgEvt;

		static DTCDebugConfig()
		{
			string environmentVariable = Environment.GetEnvironmentVariable("DTC_DEBUG_EVENT");
			if (!string.IsNullOrEmpty(environmentVariable))
			{
				try
				{
					s_DTCDbgEvt = (DTCDebugEvent)int.Parse(environmentVariable);
				}
				catch (Exception)
				{
					s_DTCDbgEvt = (DTCDebugEvent)0;
				}
			}
			if (ProviderConfig.m_bTraceLevelPrivate)
			{
				Trace.Write(OracleTraceLevel.Private, OracleTraceTag.MTS, OracleTraceClassName.DTCDebugConfig, OracleTraceFuncName.cctor, "DTC Debug Event is set to " + s_DTCDbgEvt);
			}
		}
	}
}
